package com.minelx.datamicroscope.core.condition;

import com.alibaba.fastjson.JSONObject;
import com.minelx.datamicroscope.core.query.AliasedKey;
import com.minelx.datamicroscope.core.values.CommonField;
import com.minelx.hellopandas.core.DataFrameDescription;
import io.gitee.minelx.commontools.factor.Factor;

import java.io.InputStream;
import java.util.List;
import java.util.function.Supplier;

public interface RawCondition {

    JSONObject toJSON();

    Factor<Condition> toFactor();

    static RawCondition sticky(KeyOperandCondition keyOperandCondition) {
        return new RawStickyOperandCondition(keyOperandCondition);
    }

    static RawCondition in__with_common_list_values(CommonField key,
                                                    List<String> values) {
        return new RawInValuesCondition(key, values);
    }

    static RawCondition in_or_and__with_inputStream_support(List<AliasedKey> keys,
                                                            Supplier<InputStream> streamSupplier,
                                                            DataFrameDescription description) {
        return new RawInFromStreamSourceCondition(keys, streamSupplier, description);
    }
}
